-
Notifications
You must be signed in to change notification settings - Fork 149
feat: add xblockScroll
event handler to iframeMessageTypes
#2363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2363 +/- ##
==========================================
+ Coverage 94.44% 94.47% +0.03%
==========================================
Files 1169 1169
Lines 25073 25139 +66
Branches 5460 5491 +31
==========================================
+ Hits 23679 23750 +71
- Misses 1322 1324 +2
+ Partials 72 65 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sandbox deployment successful 🚀 |
I tested this on the sandbox using a modified version of the testing instructions from openedx/edx-platform#36478
🎉 The block scrolled into view as expected! 🎉 I did notice that it didn't do a smooth scroll. I'm not sure if the smooth scroll was working as expected before or not, but when reviewing openedx/edx-platform#37152 I noticed the previous implementation had case 'scrollToXBlock':
document.getElementById(data.payload.locator)?.scrollIntoView({behavior: "smooth"});
break; I think updating
to use the |
@brian-smith-tcril updated! thanks! |
Sandbox deployment failed 💥 |
Sandbox deployment successful 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! Tested on the latest sandbox deployment and this is scrolling smoothly now!
xblockScroll
event handler to iframeMessageTypes
Description
Fixes openedx/openedx-aspects#316 by scrolling window to the xblock location instead of scrolling within the iFrame
Supporting information
Link to other information about the change, such as GitHub issues, or Discourse discussions.
Be sure to check they are publicly readable, or if not, repeat the information here.
Testing instructions
Test with openedx/edx-platform#37152
Need to enable Aspects in-context metrics (https://github.com/openedx/frontend-plugin-aspects)
Other information
Include anything else that will help reviewers and consumers understand the change.
Best Practices Checklist
We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:
.ts
,.tsx
).propTypes
,defaultProps
, andinjectIntl
patterns are not used in any new or modified code.src/testUtils.tsx
(specificallyinitializeMocks
)apiHooks.ts
in this repo for examples.messages.ts
files have adescription
for translators to use.../
. To import from parent folders, use@src
, e.g.import { initializeMocks } from '@src/testUtils';
instead offrom '../../../../testUtils'
Settings